<?php

namespace App\Http\Requests\Home;

use App\Http\Requests\Request;

class RegisterEmailRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
     public function rules()
    {
        return [
            //
        'uemail' => 'required|unique:user|email',
        'upassword'=>'required',
        'urepassword'=>'required|same:upassword'
        ];
    }

    public function messages()
    {
         return [
            'uemail.required'=>'邮箱必填',
            'uemail.unique'=>'邮箱已存在',
            'uemail.email'=>'邮箱格式错误',
            'upassword.required'=>'密码必填',
            'urepassword.required'=>'确认密码必填',
            'urepassword.same'=>'两次密码不一致'
            ];
    }
}
